/* 征信查询 */
function getZxcx(url){
	$.dpAjax({
		show:true,
		url:url,
		data:{queryCreditApplyId:queryCreditApplyId},
		success: function(datas){
			 var data = datas.result;
			 if(data){
 				 //征信信息
 				 var cusNo = data.cusNo;
 				 var cusNoPeiOu = data.cusNoPeiOu;
 				 var cusNoDanBaoRen1 = data.cusNoDanBaoRen1;
 				 var cusNoDanBaoRen2 = data.cusNoDanBaoRen2;
 				 var cusNoDanBaoRen3 = data.cusNoDanBaoRen3;
 				 var cusNoDanBaoRen4 = data.cusNoDanBaoRen4;
 				 clearAll();
 				 var zxCreditQuerys = data.zxCreditQuerys;
 				 if(zxCreditQuerys && zxCreditQuerys.length > 0) {
     				 for(var i in zxCreditQuerys) {
	     				showZx(zxCreditQuerys[i], cusNo, cusNoPeiOu, cusNoDanBaoRen1, cusNoDanBaoRen2, cusNoDanBaoRen3, cusNoDanBaoRen4);
     				 }
 				 }
			 }
         }
	});
}

//展示征信信息
function showZx(zxCreditQuery, cusNo, cusNoPeiOu, cusNoDanBaoRen1, cusNoDanBaoRen2, cusNoDanBaoRen3, cusNoDanBaoRen4){
	var target = '';
	if(zxCreditQuery.cusNo == cusNo) {
		target = 'z'
	} else if(zxCreditQuery.cusNo == cusNoPeiOu) {
		target = 'p'
	} else if(zxCreditQuery.cusNo == cusNoDanBaoRen1) {
		target = 'd1'
	} else if(zxCreditQuery.cusNo == cusNoDanBaoRen2) {
		target = 'd2'
	} else if(zxCreditQuery.cusNo == cusNoDanBaoRen3) {
		target = 'd3'
	} else if(zxCreditQuery.cusNo == cusNoDanBaoRen4) {
		target = 'd4'
	}
	showZxData(target, zxCreditQuery);
}

function showZxData(target, zxCreditQuery) {
	if(zxCreditQuery) {
		$('#'+target+'_zxCreditQueryId').val(zxCreditQuery.replaceId);
		$('#'+target+'_cusName').html(zxCreditQuery.cusName);
		$('#'+target+'_cusNo').html(zxCreditQuery.cusNo);
		$('#'+target+'_operatorDate').html(formateIntegerMinutes(zxCreditQuery.modified));
		$('#'+target+'_bankCode').html(zxCreditQuery.bankCodeDisplay);
		$('#'+target+'_loanCrdt').html(zxCreditQuery.loanCrdt);
		$('#'+target+'_cardCrdt').html(zxCreditQuery.cardCrdt);
		$('#'+target+'_leftNum').html(zxCreditQuery.leftNum);
		$('#'+target+'_leftAmount').html(showNumber(zxCreditQuery.leftAmount));
		$('#'+target+'_creditResult').html(zxCreditQuery.creditResultDisplay);
		$('#'+target+'_onceCarStatus').html(zxCreditQuery.onceCarStatusDisplay);
		$('#'+target+'_creditResultMark').html(zxCreditQuery.creditResultMark);
		$('#'+target+'_label').show();
		$('#'+target+'_div').show();
	}
}
function clearAll(){
	clear_zx('z');
	clear_zx('p');
	clear_zx('d1');
	clear_zx('d2');
	clear_zx('d3');
	clear_zx('d4');
}
function clear_zx(target){
	$('#'+target+'_label').hide();
	$('#'+target+'_div').hide();
	$('#'+target+'_zxCreditQueryId').val('');
	$('#'+target+'_cusName').html('');
	$('#'+target+'_cusNo').html('');
	$('#'+target+'_operatorDate').html('');
	$('#'+target+'_bankCode').html('');
	$('#'+target+'_loanCrdt').html('');
	$('#'+target+'_cardCrdt').html('');
	$('#'+target+'_leftNum').html('');
	$('#'+target+'_leftAmount').html('');
	$('#'+target+'_creditResult').html('');
	$('#'+target+'_onceCarStatus').html('');
	$('#'+target+'_creditResultMark').html('');
}